package com.netmi.myjectpack.bean;

import android.os.Build;

import androidx.annotation.RequiresApi;
import androidx.databinding.Bindable;
import androidx.databinding.ObservableField;
import androidx.databinding.ObservableFloat;

import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;

/**
 * 类描述：双向数据绑定的类
 * 创建人：tgw
 * 创建时间：2020/8/6
 * 修改备注：
 */

public class ObservableGoods {
    //java 8 特性
//    List<String> strings = Arrays.asList("abc", "", "bc", "efg", "abcd","", "jkl");
//    // 获取空字符串的数量
//    int count = (int) strings.stream().filter(new Predicate<String>() {
//        @Override
//        public boolean test(String string) {
//            return string.isEmpty();
//        }
//    }).count();
    private String address;
    private ObservableField<String> name;

    private ObservableField<String> details;

    private ObservableFloat price;

    public ObservableGoods(String name, String details, float price,String address) {
        this.name = new ObservableField<>(name);
        this.details = new ObservableField<>(details);
        this.price = new ObservableFloat(price);
        this.address = address;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public ObservableField<String> getName() {
        return name;
    }

    public void setName(ObservableField<String> name) {
        this.name = name;

    }

    public ObservableField<String> getDetails() {
        return details;
    }

    public void setDetails(ObservableField<String> details) {
        this.details = details;
    }

    public ObservableFloat getPrice() {
        return price;
    }

    public void setPrice(ObservableFloat price) {
        this.price = price;
    }

}